#ifndef MAINWID_H
#define MAINWID_H

#include "myChannel.h"

#include <QMainWindow>
#include <QStandardItemModel>

#include <iostream>

#include <QWebEngineView>
#include <QWebChannel>
#include <QMessageBox>
#include <QJsonObject>
#include <QJsonArray>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QListWidget>
#include <QTableWidget>
#include <QGroupBox>
#include <QPushButton>
#include <QLineEdit>
#include <QFile>
#include <QDataStream>
#include "child.h"
#include "qmqtt.h"
#include<QDebug>
#include "qqueue.h"
#include "qmap.h"
#include "qvector.h"
#include "jing.h"
#include "add.h"

namespace Ui {
class Mainwid;
}

class Mainwid : public QMainWindow
{
    Q_OBJECT

public:
    explicit Mainwid(QWidget *parent = 0);
    ~Mainwid();
    void setCity();
    void setCity_addr(QString addr);
    void setAutoComplete(QJsonObject result);
    void searhInputChanged();
    void addbasic();
    void jingbasic();
    void doubleclickplay(int a,int b);
    QString get_last_wen(QString name);
    QString Name;
    int count=-1;
public slots:
    void flushtable();
    void addmess();
    void openchild(int i);
    void deletebasic();
    void on_pb_connect_clicked();
    void doDataReceived(QMQTT::Message);//MQTT收到数据
    void Tablechange(int row);
    void showxiangxi();
private slots:
    void on_kongtiao_textChanged(const QString &arg1);

private:
    Ui::Mainwid *ui;
    myChannel * _myChannel;
    QStandardItemModel * _mItemModel;
    QTableWidget *table;

    QVector<QPushButton*> xx;
    jing *baojing;
    Add *addjizhan;
    QMap<QString,child*> chi;
    QMap<QString,QQueue<QString>> jizhan;
    QMQTT::Client *client; //MQTT客户端指针
    QTableWidgetItem* item;
};

#endif // MAINWID_H
